package ge.modules.ia;

import ge.engine.Actor;

/**
 * 
 * Represent one state of the state Machine
 * @author abel.botrdonado
 *
 */
public interface IMachineState<T extends Actor> 
{
	/**
	 * This function is called when the state is first time
	 * executed.
	 */
	public void enter(T actor);
	
	/**
	 * This function is called each update of the machine when 
	 * the state is selected
	 */
	public void execute(T actor);
	/**
	 * This function is called before the state is replaced for other in
	 * the state machine
	 */
	public void exit(T actor);
	
	/**
	 *  Handles the message send by another MachineState. 
	 *  Make sure you use the MessageDispatcher module in your level or any message will be sent
	 * @param m Message
	 * @return True if has handled the message
	 */
	public boolean handleMessage(T actor,Message m);
	
}
